package com.example.gybicycle.service;

import java.util.Date;
import com.example.gybicycle.common.entity.Result;
import com.example.gybicycle.common.sql.CrudService;
import com.example.gybicycle.entity.Insure;
import com.example.gybicycle.dao.InsureDao;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class InsureService extends CrudService<InsureDao, Insure> {
    @Override
    public Insure get(Integer id) {
        Insure table=super.get(id);
        return table;
    }
    public String getInsureNotice(){
        Insure insure=super.get(1);
        if(insure==null)
            return "";
        String notice="";
               /* "<p><strong>产品投保范围：</strong>参加爱可赢健康骑行项目的游客 </p>\n" +
                notice+="<p><strong>保 &nbsp;险 &nbsp;期 &nbsp; 限：</strong>"+insure.getTerm()+"</p>\n" +
                notice+="<p><strong>保 &nbsp;险 &nbsp;金 &nbsp; 额：</strong>"+insure.getMoney()+"</p>\n" +
                notice+="<p><strong>保 &nbsp;险 &nbsp;公 &nbsp; 司：</strong>"+insure.getCompanyName()+"</p>\n" +
                notice+="<p><strong>产品投保需知:</strong></p>"+insure.getContnent();*/
        if(insure.getName()!=null)
            notice+="<p><strong>产 &nbsp;品 &nbsp;名 &nbsp;称 ：</strong>"+insure.getName()+"</p>\n";
        if(insure.getRange()!=null)
            notice+="<p><strong>产品投保范围：</strong>"+insure.getRange()+" </p>\n" ;
        if(insure.getTerm()!=null)
            notice+="<p><strong>保 &nbsp;险 &nbsp;期 &nbsp; 限：</strong>"+insure.getTerm()+"</p>\n";
        if(insure.getMoney()!=null)
            notice+="<p><strong>保 &nbsp;险 &nbsp;金 &nbsp; 额：</strong>"+insure.getMoney()+"</p>\n" ;
        if(insure.getCompany()!=null)
            notice+="<p><strong>保 &nbsp;险 &nbsp;公 &nbsp; 司：</strong>"+insure.getCompany()+"</p>\n" ;
        if(insure.getTelphone()!=null)
            notice+="<p><strong>联 &nbsp;系 &nbsp;电 &nbsp; 话：</strong>"+insure.getTelphone()+"</p>\n" ;
        if(insure.getContnent()!=null)
            notice+="<p><strong>产品投保需知:</strong></p>"+insure.getContnent();
        return notice;
    }
    public List<Insure> findList(Insure entity){
        List<Insure> list=super.findList(entity);
        return list;
    }


}